<h2>View Library <?php echo $model->id; ?></h2>

<div class="actionBar">
[<?php echo CHtml::link('Library List',array('list')); ?>]
[<?php echo CHtml::link('New Library',array('create')); ?>]
[<?php echo CHtml::link('Update Library',array('update','id'=>$model->id)); ?>]
[<?php echo CHtml::linkButton('Delete Library',array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure?')); ?>
]
[<?php echo CHtml::link('Manage Library',array('admin')); ?>]
</div>

<table class="dataGrid">
<tr>
	<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('name')); ?>
</th>
    <td><?php echo CHtml::encode($model->name); ?>
</td>
</tr>
<tr>
	<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('services')); ?>
</th>
    <td><?php foreach($model->services as $i=>$service) echo ($i>0?', ':'').CHtml::encode($service->name); ?>
</td>
</tr>
<tr>
	<th class="label"><?php echo CHtml::encode($model->getAttributeLabel('libraryBooks')); ?>
</th>
<td>
<ul>
<?php foreach($model->libraryBooks as $libraryBook): ?>
    	<li><?php echo CHtml::link("{$libraryBook->book->title} ($libraryBook->location)",array('book/show','id'=>$libraryBook->book->id)); ?></li>
<?php endforeach; ?>
</ul>
</td>
</tr>
</table>
